<?php
require_once("classes/myDatabase.php");

class User extends Database{

        public function getpostStatus(){
                $this->connectDatabase();
                $sQuery = "SELECT userinfo.fname,userinfo.lname,user_status.post_status
                           FROM userinfo,user_status
                           WHERE user_status.user_id = userinfo.user_id AND user_status.status_id
                           ORDER BY status_id DESC";
                $result = mysql_query($sQuery);
                $ctr = 0;
                while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
                    $user[$ctr++] = array('status'=> $row['post_status'],
                                          'fname'=> $row['fname'],
                                          'lname'=> $row['lname']);
                }
                if(!isset($user)){
                    $user = null;
                }
                return $user;
        }
}
?>